# coding=utf-8

def isUsernameLegal(username):
    '''判断用户名是否合法，用户名只能有数字和字母和下划线构成'''
    for e in username:
        if e != '_' and (e<'0' or e>'9') and (e<'a' or e>'z') and (e<'A' or e>'Z'):
            return False
    return True